#!/usr/bin/env sh
# shellcheck disable=SC2086
# shellcheck disable=SC2038
# shellcheck disable=SC2154
# shellcheck disable=SC2086
# shellcheck disable=SC2046

chmod +x ../gradlew
export GRADLE_USER_HOME=~/.gradle

# delete biz dependency
find $GRADLE_USER_HOME/caches/modules-2 -type d -regextype posix-extended -iregex '.*(hfhk|cairo|lijiajia).*' | xargs rm -rf  {}
# build
../gradlew :cairo-system-service:clean bootJar -x test
# layer extract
java -Djarmode=layertools -jar $(find cairo-system-service/build/libs -name '*-boot.jar') extract --destination build
